<?php
echo "<pre>";
$dbms = "mysql";
$server = "localhost";
$username = "root";
$password = "";
$dbname = "account_db";
$dsn = "$dbms:host=$server;dbname=$dbname";
try {
$pdo = new PDO ( $dsn, $username, $password );
echo "PDO连接MySQL数据库成功";
$pre = $pdo->prepare ( "nsert into account(username, password, email) values (?,?,?)" );
$name = "DullSea";
$pwd = "666666";
$pre->bindParam ( 1, $name );
$pre->bindValue ( 2, $pwd );
$pre->bindValue ( 3, "5353546@qq.com");
$pre->execute ();

$name = "溟海";
$pre->execute ( array (
	$name,
	"1245",
	"awp@163.com"
) );
$pre = $pdo->prepare ( "nsert into account(username, password, email) values (:name,:pwd,:email)");
$name = "田所浩二";
$pwd = "114514";
$email = "henghengaaa@163.com";
$pre->bindParam (":name",$name );
$pre->bindParam (":pwd",$pwd );
$pre->bindParam (":email",$email);
$pre->execute ();
$name = "比利海灵顿";
$pre->execute ( array (
":name" => $name,
"pwd"=> "love",
"email"=> "van@qq.com",
) );
$pdo = null;
} catch (PDOException $e ) {
	echo "pdo连接MySQL失败";
	die ();
}
?>